#ifndef _MODEL_PROXY_H_
#define _MODEL_PROXY_H_

#include "include/MysqlProxy.h"
#include "include/MemcacheProxy.h"

class ModelProxy
{
public:
	~ModelProxy();
	void Init();
	int BeginTransaction();
	void BreakTransaction();
	void EndTransaction();

	int ReplaceMemcacheObject(string key, string &value);
	int GetMemcacheObject(string key, string &value);
	int SetMemcacheObject(string key, string &value);
	int DelMemcacheObject(string key);
	int GetObjectBySql(string key, string &sql, string &value);
	int GetObjectById(string table_name, string id_name, int id_value, string &value);
	int GetObjectById(string table_name, string id_name, string id_value, string &value);
	int InsertObject(string table_name, string &value);
	int ReplaceObject(string table_name, string &value);
	int ReplaceObjectById(string table_name, string id_name, int id_value, string &value);
    string GetSingleStrBySql(string &sql);

private:
	MysqlProxy _mysql_proxy;
	MemcacheProxy _memcache_proxy;

};

#endif
